<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>SPRG</title>
    <link rel="stylesheet" href="./style/global.css">
    <link rel="stylesheet" href="./style/index.css">
</head>

<body>
    <nav>
        <p></p>
        <div>
            <button data-even='min'>
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-minimum"></use>
                </svg>
            </button>
            <button class="new">new</button>
            <button data-even='close'>
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-guanbi"></use>
                </svg>
            </button>
        <div>
    </nav>
</body>
<script src="./sources/font/iconfont.js"></script>
<script>
    // 主程序和全局属性和引入
    require('./index');
    const electron = require('electron');
    const ipc = electron.ipcRenderer;
    const remote = electron.remote;
    const { BrowserWindow } = remote;
    const lowdb = require('./data/createLow');
    const Character = require('./bases/Character');
</script>

<script>
    // document.querySelector("[data-even='max']").addEventListener('click', () => {
    //     ipc.send('window-max'); // zuidahua zuidahua1
    // })
    document.querySelector("[data-even='min']").addEventListener('click', () => {
        ipc.send('window-min');
    })
    document.querySelector("[data-even='close']").addEventListener('click', () => {
        ipc.send('window-close');
    })
</script>

<script>
    const win = remote.getGlobal('win');
    const newbtn = document.querySelector('.new');
    newbtn.addEventListener('click', () => {
        let winChild = new BrowserWindow({ width: 480, height: 320, transparent: true, /*frame: false,*/ resizable: false, parent: win, modal: true, show: false })
        winChild.loadFile('./html/role.html');
        winChild.on('ready-to-show', () => {
            winChild.show()
        })
    })

    ipc.on('games', (ev, npc) => {
        console.log(npc, npc.unEquipment)
    })
</script>

</html>